{% extends 'student/base.html' %}
{% block title %}学生信息编辑{% endblock %}
{% block section %}{{ section }}{% endblock %}
{% block index %}
    <form class="form-horizontal" method="post">
    {% csrf_token %}
  <div class="form-group">
    <label for="name" class="col-sm-2 control-label">姓名</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="name" placeholder="请输入姓名" name="name" value='{{ student.name }}'}>
    </div>
  </div>
  <div class="form-group">
    <label for="age" class="col-sm-2 control-label">年龄</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="age" placeholder="请输入年龄" name="age" value="{{ student.age }}">
    </div>
  </div>
  <div class="form-group">
    <label for="sex" class="col-sm-2 control-label">性别</label>
        <div class="radio">
          <label>
            &emsp;<input type="radio" name="sex" id="sex" value="0" {% if student.sex == 0 %}checked{% endif %}>女&emsp;&emsp;
              </label><label>
            <input type="radio" name="sex" id="sex" value="1" {% if student.sex == 1 %}checked{% endif %}>男
          </label>
        </div>
  </div>
  <div class="form-group">
    <label for="qq" class="col-sm-2 control-label">qq</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="qq" placeholder="请输入qq" name="qq" value="{{ student.qq }}">
    </div>
  </div>
  <div class="form-group">
    <label for="phone" class="col-sm-2 control-label">电话</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="phone" placeholder="请输入电话" name="phone" value="{{ student.phone }}">
    </div>
  </div>
  <div class="form-group">
    <label for="num" class="col-sm-2 control-label">身份证</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="num" placeholder="请输入身份证" name="num" value={{ stu_detail.num}}>
    </div>
  </div>
  <div class="form-group">
    <label for="college" class="col-sm-2 control-label">毕业大学</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" id="college" placeholder="请输入毕业大学" name="college" value={{ stu_detail.college }}>
    </div>
  </div>
  <div class="form-group">
    <label for="grade" class="col-sm-2 control-label">班级</label>
    <div class="col-sm-3">
        <select class="form-control" name="grade" id="grade">
            <option >无</option>
            {% for g in grade %}
             <option {% if g == student.grade %}selected{% endif %} value={{ g.id }}>{{ g }}</option>
            {% endfor %}
        </select>
    </div>
  </div>
  <div class="form-group">
      <label for="course" class="col-sm-2 control-label">课程</label>
    <div class="col-sm-3">
        {% for c in course %}
        <label class="checkbox-inline">
        <input type="checkbox" id="inlineCheckbox1" value="option1"> {{ c.name }}
        </label>
        {% endfor %}
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
        {% if section != '学生个人详情' %}
      <button type="submit" class="btn btn-default">保存</button>
      <a type="reset" class="btn btn-primary" href={% url 'student:student_edit' 0 %}>重置</a>
       {% endif %}
      <a type="button" class="btn btn-danger" href={% url 'student:index' %}>返回</a>

    </div>
  </div>
    </form>
{% endblock %}